/**
 * ClassTaskTypeFactory.java
 * com.sitech.dmcs.core.factory
 * Function： TODO 
 *
 *   ver  author   date    
 * ──────────────────────────────────
 *   	 geutopia  Jan 6, 2011        
 *
 * Copyright (c) 2011, TNT All Rights Reserved.
 */

package com.sitech.timing.factory;

import com.sitech.timing.domain.TaskType;
import com.sitech.timing.Task;
import com.sitech.timing.TaskTypeFactory;

/**
 * ClassName:ClassTaskTypeFactory Function: TODO ADD FUNCTION Reason: TODO ADD
 * REASON
 * 
 * @author geutopia
 * @version
 * @since Ver 1.1
 * @Date 2011 Jan 6, 2011 10:53:17 AM
 * 
 * @see
 */

public class ClassTaskTypeFactory implements TaskTypeFactory
{

	/**
	 * (non-Javadoc)
	 * 
	 * @see com.sitech.timing.TaskTypeFactory#getTaskByTaskTaskType(com.sitech.timing.domain.TaskType)
	 */
	public Task getTaskByTaskTaskType(TaskType taskType)
	{
		// TODO Auto-generated method stub
		try
		{
			if (taskType != null && taskType.getTaskTypeClass() != null)
			{
				Object object = Class.forName(taskType.getTaskTypeClass()).newInstance();
				if (object instanceof Task)
				{
					Task task = (Task) object;
					return task;

				}
			}
		}
		catch (Exception e)
		{
			// TODO: handle exception
		}

		return null;
	}

}
